-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating date-fns library from 1.x to 2.x #10848
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple things to double-check, but thanks for making all these updates!
// TODO: minStart, maxEnd | ||
let params = {}; | ||
if (start) { | ||
let startDate = parseDateString(start); | ||
if (startDate) { | ||
// TODO: Replace with formatRFC3339 when date-fns is updated | ||
params.start_time = format(addDays(startDate, 1), 'X'); | ||
// converts to milliseconds, divide by 1000 to get epoch | ||
params.start_time = getTime(startDate) / 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure we added days because there was some weirdness with UTC, but if the tests pass with this update we should be ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thanks for tackling this
@@ -14,4 +17,31 @@ module('Integration | Helper | date-from-now', function(hooks) { | |||
let result = dateFromNow([1481022124443], { addSuffix: true }); | |||
assert.ok(result.includes(' ago')); | |||
}); | |||
|
|||
test('you can pass in UTC timestamp', function(assert) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
We need to update this library to take advantage of the new methods available in version 2.^ for the Database Secret Engine project.
Worked through the breaking changes according to the date-fns changelog, but also issues that came up in the failed test. For example, AM/PM from
A
toa
.